#include "hitbox.h"
#include <cmath>

double Hitbox::distance(double x0, double y0, double x1, double y1)
{
    return sqrt((x1 - x0)*(x1 - x0) + (y1 - y0)*(y1 - y0));
}

bool Hitbox::overlaps(Hitbox* h)
{
    if (distance(x, y, h->x, h->y) < (rad + h->rad))
        return true;
    else
        return false;
}
